﻿using System;
using System.Net;
using PostSharp.Laos;

namespace FutureVision.Infrastructure
{
    [Serializable]
    [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Class)]
    public class LogExceptionAspect : OnExceptionAspect
    {
        public override void OnException(MethodExecutionEventArgs eventArgs)
        {
            base.OnException(eventArgs);

            Elmah.ErrorSignal.FromCurrentContext().Raise(eventArgs.Exception, System.Web.HttpContext.Current);

            //LogService.Default.Error(eventArgs.Exception.ToString());
        }
    }
}